﻿
Imports System.Configuration
Imports System.Data.Common

Imports Moca.Db
Imports Moca.Win

Public Class ConnectionStrings

	Private _settingModel As DbContextProperty

	Public ReadOnly Property SettingModel() As DbContextProperty
		Get
			Return _settingModel
		End Get
	End Property

	'--------------------------------------------------------------------------
	''' <summary>
	''' フォームロード
	''' </summary>
	''' <param name="sender"></param>
	''' <param name="e"></param>
	''' <remarks></remarks>
	Private Sub Configuration_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

		_settingModel = New DbContextProperty()
		PropertyGrid1.SelectedObject = _settingModel

	End Sub

	'--------------------------------------------------------------------------
	''' <summary>
	''' OK ボタン
	''' </summary>
	''' <param name="sender"></param>
	''' <param name="e"></param>
	''' <remarks></remarks>
	Private Sub OK_Config_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Config.Click
		My.MySettings.Default.DbContext.Add(_settingModel)

		Me.DialogResult = Windows.Forms.DialogResult.OK
	End Sub

	'--------------------------------------------------------------------------
	''' <summary>
	''' Cancelボタン
	''' </summary>
	''' <param name="sender"></param>
	''' <param name="e"></param>
	''' <remarks></remarks>
	Private Sub Cancel_config_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Config.Click
		Me.DialogResult = Windows.Forms.DialogResult.Cancel
	End Sub

End Class